home *** CD-ROM | disk | FTP | other *** search
/ Invisible Universe / Invisible Universe (1995)(Voyager)[Mac-PC].iso / mac / UNIVERSE / SHARED.DIR / 01009_Script_playHelp < prev    next >
Text File  |  1995-11-21  |  10KB  |  395 lines

  1. --on frames where help movie plays
  2. --on exitFrame
  3. --  GHelpIdle
  4. --  go to the frame
  5. --end
  6. --
  7. --on the last frame of the movie
  8. --on idle
  9. --end idle
  10. --
  11. --on exitFrame
  12. --  global gHelpDuration
  13. --  if the movieTime of sprite 48 = gHelpDuration then playHelp
  14. --  else go to the frame
  15. --end
  16. --
  17. --in the movie cast's script
  18. --on mouseDown
  19. --  global gFiorellaOnStage
  20. --  if gFiorellaOnStage then playHelp
  21. --end mouseDown
  22.  
  23. on playHelp whichArea
  24.   global gFiorellaOnStage,gMovieFrame,gHelpDuration, gHelpMovie,gFrameToReturnTo
  25.   global gMovieTimeList, gMovieTimeIndex, gMovieTimeMax
  26.   global gFixPalShared, gMovieToReturnTo, gVolume
  27.   global gTOCMovie
  28.   
  29.   
  30.   --put ">>> which area = " & whichArea
  31.   
  32.   global gCom, gCurLabelProp
  33.   
  34.   if the timer < 60 then exit
  35.   
  36.   --set the trace = 1
  37.   
  38.   --put ">>>playHelp which area = " && whichArea
  39.   if gFiorellaOnStage then 
  40.     --put ">>>Playhelp called during a movie."
  41.     stopHelp  
  42.     
  43.   else
  44.     cursor 4
  45.     
  46.     set gTOCMovie = 0
  47.     
  48.     if char 1 of the frameLabel = "O" then
  49.       --popRetraceMenu 1
  50.       go to Label("OM")
  51.     end if
  52.     
  53.     
  54.     put the frame into gFrameToReturnTo 
  55.     
  56.     if not voidP(whichArea) then
  57.       --put ">>> not void whichArea"
  58.       
  59.       do field (whichArea && "Movie Times")
  60.       set gMovieTimeMax = getAt(gMovieTimeList, 1)
  61.       
  62.       put label(whichArea&&"Help") into gMovieFrame
  63.       set ct = count(gMovieTimeList)
  64.     end if
  65.     
  66.     if the movie = "TOC.DIR" then
  67.       set gTOCMovie = 1
  68.       set gMovieToReturnTo = the Movie
  69.       
  70.       if the frameLabel = "TOCM" then
  71.         set gFrameToReturnTo = label("TOCM Video")
  72.       end if
  73.       
  74.       if char 1 of the frameLabel <> "P" then
  75.         set gMovieFrame = 2
  76.         set newMovie = the frameLabel & ".DIR"
  77.         go to movie newMovie
  78.       else
  79.         set gMovieFrame = integer(char 2 of the frameLabel) * 2
  80.         set newMovie = "P.DIR"
  81.         go to frame (gMovieFrame-1) of movie newMovie  
  82.       end if
  83.       
  84.       set the visible of sprite 48 to false
  85.       
  86.       go to the frame + 1
  87.     end if
  88.     
  89.     if voidP(whichArea) or ct = 0 then
  90.       
  91.       --
  92.       --
  93.       -- Check if the video was placed elsewhere
  94.       --
  95.       updateStage
  96.       --put ">>>playmovie the castnum of sprite 48 = " & the castnum of sprite 48
  97.       
  98.       if (the castNum of sprite 48) = 0 then
  99.         set newMovie = gCurLabelProp & ".DIR"
  100.         
  101.         set gMovieToReturnTo = the Movie
  102.         
  103.         go to movie newMovie
  104.         
  105.         set the visible of sprite 48 to false
  106.         
  107.         go to the frame + 1
  108.       end if
  109.       
  110.       --
  111.       --
  112.       -- If a movie does not have key frames, then see if it is in an 
  113.       -- external file
  114.       --
  115.       
  116.       set gMovieFrame = the frame
  117.       set ct = 0
  118.       
  119.       
  120.     end if
  121.     
  122.     
  123.     
  124.     if the machineType <> 256 then
  125.       if voidP(gFixPalShared) then setupFixPal
  126.       
  127.       gFixPalShared(mPatchIt)
  128.     end if
  129.     
  130.     
  131.     
  132.     set gFiorellaOnStage to true
  133.     
  134.     
  135.     --unload 1,5000
  136.     
  137.     put the freeBytes
  138.     if the freeBytes < 500000 then 
  139.       --put ">>> playhelp: calling maxmem"
  140.       --unloadCast 1,1000
  141.       if the machineType <> 256 then maxmem()
  142.       put the freeBytes
  143.     end if
  144.     
  145.     set gMovieTimeIndex = 1
  146.     --put ">>>Area: " & whichArea
  147.     
  148.     
  149.     --set the visible of sprite 48 to false
  150.     
  151.     -- keep a copy of the poetry titles on screen
  152.     
  153.     
  154.     --put ">>> preloading" & gMovieFrame && gMovieFrame+ct
  155.     if ct = 0 and the frame <> gMovieFrame then      
  156.       set the preLoadEventAbort = 0 
  157.       preload gMovieFrame, gMovieFrame+ct
  158.       set the preLoadEventAbort = 1 
  159.     end if
  160.     
  161.     go frame gMovieFrame
  162.     
  163.     --puppetSprite 48,true
  164.     
  165.     --updateStage
  166.     
  167.     --set the preLoadRam = 1024
  168.     
  169.     set the movieTime of sprite 48 to 0
  170.     put the number of cast(the castNum of sprite 48) into gHelpMovie
  171.     
  172.     if the pausedAtStart of cast gHelpMovie <> 1 then 
  173.       Alert "[This is a minor problem, but should be noted.]" & RETURN & RETURN & "Please enable " & quote & "paused at start" & quote & " for cast member " & gHelpMovie & " in movie: " & the movie & "." 
  174.     end if
  175.     
  176.     set the directToStage of cast gHelpMovie to true
  177.     put the duration of cast gHelpMovie into gHelpDuration
  178.     
  179.     --put ">>>Duration = " & gHelpDuration
  180.     
  181.     --put ">>> set the preload"
  182.     --set the preLoad of cast gHelpMovie to true
  183.     --put ">>> do the preload"
  184.     --preLoadCast gHelpMovie
  185.     --put ">>> done preloading..."    
  186.     --updateStage
  187.     --set the movieRate of sprite 48 to .01
  188.     --go to the frame
  189.     
  190.     set the visible of sprite 48 to true
  191.     
  192.     if the machineType <> 256 then
  193.       set the movieRate of sprite 48 to .01
  194.     end if
  195.     
  196.     updateStage -- go to the frame
  197.     
  198.     set the volume of sprite 48 to gVolume
  199.     
  200.     --updateStage
  201.     starttimer
  202.     
  203.     cursor -1
  204.     
  205.     set the movieRate of sprite 48 to 1
  206.   end if
  207. end playHelp
  208.  
  209. on stopHelp
  210.   global gFiorellaOnStage, gHelpMovie, gFrameToReturnTo, gHelpDuration, gMovieFrame
  211.   global gCom, gNavPalette
  212.   global gCurLabelProp, gMovieToReturnTo, gVolume
  213.   global gTOCMovie
  214.   
  215.   if the timer < 60 then exit
  216.   if the movieTime of sprite 48 < 60 then exit
  217.   
  218.   cursor 4
  219.   
  220.   set gFiorellaOnStage to false
  221.   
  222.   repeat with i = 1 to 8
  223.     set the volume of sprite 48 to (the volume of sprite 48)/2
  224.     set t = the ticks + 10
  225.     repeat while the ticks < t 
  226.       go to the frame
  227.     end repeat
  228.   end repeat
  229.   
  230.   
  231.   set the visible of sprite 48 to false
  232.   set the movieRate of sprite 48 to 0
  233.   set the volume of sprite 48 = gVolume
  234.   
  235.   updateStage
  236.   
  237.   --set the movieTime of sprite 48 to 0
  238.   --set the preLoad of cast gHelpMovie to false
  239.   --unloadCast gHelpMovie
  240.   --set the directToStage of cast gHelpMovie to false
  241.   
  242.   --set the preLoadRam = 0
  243.   
  244.   if gTOCMovie then
  245.     go to frame gFrameToReturnTo of movie gMovieToReturnTo
  246.   end if
  247.   
  248.   
  249.   if the movie = (gCurLabelProp & ".DIR") then 
  250.     go to frame gCurLabelProp && "Video" of movie gMovieToReturnTo
  251.     go to gFrameToReturnTo
  252.     showButtons
  253.     if char 1 of the movie = "O" then tell gNavPalette to lOpenNavPalette
  254.     
  255.     --    goGo(gCurLabelProp, 1)
  256.   else
  257.     
  258.     if not(gCom) then 
  259.       --set the visible of sprite 48 to true
  260.       --puppetSprite 48,false
  261.     else
  262.       --set the castNum of sprite 48 = 0
  263.       showButtons
  264.       tell gNavPalette to lOpenNavPalette
  265.     end if
  266.     
  267.     go frame gFrameToReturnTo
  268.     
  269.   end if
  270.   
  271.   put empty into gFrameToReturnTo
  272.   put empty into gMovieToReturnTo
  273.   
  274.   
  275.   
  276.   --updateStage
  277.   put empty into gHelpMovie
  278.   put 0 into gHelpDuration
  279.   put 0 into gMovieFrame
  280.     
  281.   cursor -1
  282.   
  283. end stopHelp
  284.  
  285. on TOCHelpIdleXXXX
  286.   global gFiorellaOnStage, gMovieFrame, gHelpDuration
  287.   if gFiorellaOnStage then
  288.     put the movieTime of sprite 48 into it
  289.     if it < 2040 then --intro
  290.       go frame gMovieFrame
  291.     else if it < 2107 then --Celestial Objects
  292.       go frame gMovieFrame+1
  293.     else if it < 2354 then
  294.       go frame gMovieFrame+2
  295.     else if it < 2413 then --Guided Tour
  296.       go frame gMovieFrame+3
  297.     else if it < 2450 then
  298.       go frame gMovieFrame+4
  299.     else if it < 2624 then --Movies
  300.       go frame gMovieFrame+5
  301.     else if it < 2650 then 
  302.       go frame gMovieFrame+6
  303.     else if it < 2698 then --Music
  304.       go frame gMovieFrame+7
  305.     else if it < 2947 then 
  306.       go frame gMovieFrame+8
  307.     else if it < 3024 then --Poetry
  308.       go frame gMovieFrame+9
  309.     else if it < 3448 then 
  310.       go frame gMovieFrame+10
  311.     else if it < 3538 then --Menubar
  312.       go frame gMovieFrame+11
  313.       installMenu cast "TOC Help Menu"
  314.     else if it < 3556 then 
  315.       go frame gMovieFrame+12
  316.     else if it < 3620 then --Fiorella
  317.       installMenu 0
  318.       updateStage
  319.       go frame gMovieFrame+13 
  320.     else if (it < gHelpDuration) then
  321.       go frame gMovieFrame+14
  322.     else stopHelp
  323.   end if
  324. end TOCHelpIdle
  325.  
  326.  
  327. on TOCHelpIdle
  328.   global gMovieTimeMax
  329.   
  330.   if the movieTime of sprite 48 < gMovieTimeMax then
  331.     exit
  332.   else
  333.     
  334.     global gMovieTimeList, gMovieTimeIndex
  335.     
  336.     set gMovieTimeIndex = gMovieTimeIndex + 1
  337.     set gMovieTimeMax = getAt(gMovieTimeList, gMovieTimeIndex)
  338.     
  339.     if listP(gMovieTimeMax) then
  340.       do getAt(gMovieTimeMax, 2)
  341.       set gMovieTimeMax = getAt(gMovieTimeMax, 1)
  342.     end if
  343.     
  344.     go to the frame + 1
  345.     
  346.   end if  
  347. end TOCHelpIdle
  348.  
  349. --put ">>> gMovieTimeMax" && gMovieTimeMax && the movieTime of sprite 48 && the frame   
  350.  
  351.  
  352. on OHelpIdle
  353.   global gFiorellaOnStage
  354.   global gMovieTimeList, gMovieTimeIndex, gMovieTimeMax
  355.   
  356.   if gFiorellaOnStage then
  357.     if the movieTime of sprite 48 < gMovieTimeMax then
  358.       go to the frame
  359.     else
  360.       go to the frame + 1
  361.       set gMovieTimeIndex = gMovieTimeIndex + 1
  362.       set gMovieTimeMax = getAt(gMovieTimeList, gMovieTimeIndex)
  363.       if listP(gMovieTimeMax) then
  364.         do getAt(gMovieTimeMax, 2)
  365.         set gMovieTimeMax = getAt(gMovieTimeMax, 1)
  366.       end if
  367.       --put ">>> gMovieTimeMax" && gMovieTimeMax && the movieTime of sprite 48 && the frame   
  368.     end if
  369.   end if
  370.   
  371.   --updateStage
  372.   
  373. end OHelpIdle
  374.  
  375. --
  376. --
  377. -- Okay, what does this routine do???
  378. --
  379. on GHelpIdle
  380.   global gFiorellaOnStage, gMovieFrame,gHelpDuration
  381.   --g for generic
  382.   if gFiorellaOnStage then
  383.     put the movieTime of sprite 48 into it
  384.     
  385.     if (it < gHelpDuration) then
  386.       go frame gMovieFrame+1
  387.     else 
  388.       --      alert "GHelpIdle handler... bizarre case..."
  389.       --asdf
  390.       stopHelp
  391.     end if
  392.     
  393.   end if
  394. end GHelpIdle
  395.